package org.breathe.dynamic.thread.pool.core.monitor.collector;

import cn.hutool.json.JSONUtil;
import org.breathe.thread.pool.common.entity.ThreadPoolStats;
import org.breathe.thread.pool.common.enums.CollectorTypeEnum;
import org.breathe.thread.pool.common.utils.LogUtil;

/**
 * @author: breathe
 * @createTime: 2025-04-14
 */
public class LogCollector extends AbstractCollector{
    @Override
    public void collect(ThreadPoolStats threadPoolStats) {
        String metrics = JSONUtil.toJsonStr(threadPoolStats);
        LogUtil.MONITOR_LOGGER.info("{}", metrics);
    }

    @Override
    public String type() {
        return CollectorTypeEnum.LOGGING.name();
    }
}
